﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Alfa.Math.Game {
	public class Vector2 : Vector {
		public Vector2( )
			: base(2) {
		}

		public Vector2(float X, float Y)
			: base(2) {
			this[0] = X;
			this[1] = Y;
		}

		public float X { get { return this[0]; } set { this[0] = value; } }
		public float Y { get { return this[1]; } set { this[1] = value; } }

		/// <summary>
		/// Returns a unit Vector designating down (0, −1, 0).
		/// </summary>
		public static Vector2 Down { get { return new Vector2(0, -1); } }

		/// <summary>
		/// Returns a unit Vector designating left (−1, 0, 0).
		/// </summary>
		public static Vector2 Left { get { return new Vector2(-1, 0); } }

		/// <summary>
		/// Returns a Vector with ones in all of its components.
		/// </summary>
		public static Vector2 One { get { return new Vector2(1, 1); } }

		/// <summary>
		/// Returns a unit Vector pointing to the right (1, 0, 0).
		/// </summary>
		public static Vector2 Right { get { return new Vector2(1, 0); } }

		/// <summary>
		/// Returns the x unit Vector (1, 0, 0).
		/// </summary>
		public static Vector2 UnitX { get { return new Vector2(1, 0); } }

		/// <summary>
		/// Returns the y unit Vector (0, 1, 0).
		/// </summary>
		public static Vector2 UnitY { get { return new Vector2(0, 1); } }

		/// <summary>
		/// Returns a unit vector designating up (0, 1, 0).
		/// </summary>
		public static Vector2 Up { get { return new Vector2(0, 1); } }

		/// <summary>
		/// Returns a Vector with all of its components set to zero.
		/// </summary>
		public static Vector2 Zero { get { return new Vector2(0, 0); } }
	}
}
